#ifndef FILE_JS
#define FILE_JS

#include "Action.js"

var File = function(/* XmlNode */ node)
{
	/* Not possible with 'xml2js' parser... */
	/*if (node.namespace() == null ||
		node.namespace().href() != "http://objective-javascript.googlecode.com/files/Ojsproj.xsd")
	{
		throw "Invalid file.";
	}*/
	
	var /* string */ _name;
	var /* Action */ _action = Action.Compile;
	
	(function()
	{
		if(node.Name != undefined)
		{
			_name = node.Name;
		}
		else
		{
			throw "Missing required attribute 'Name'.";
		}
		
		if(node.Action != undefined)
		{
			_action = Action.Parse(node.Action);
		}
	})();
	
	this.__defineGetter__("Name", function() { return _name; });
	this.__defineGetter__("Action", function() { return _action; });
};

#endif
